<?php

/**
 * Interface declaration for Structures_LocationInterface
 *
 * PHP version 5
 *
 * LICENSE:
 *
 * Copyright (c) 2007-2009, Philippe Jausions / 11abacus
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *   - Neither the name of 11abacus nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Structures
 * @package   Structures_Location
 * @author    Philippe Jausions <Philippe.Jausions@11abacus.com>
 * @copyright 2007-2009 by Philippe Jausions / 11abacus
 * @license   http://www.opensource.net/licenses/bsd-license.php New BSD
 */

/**
 * Interface declaration for Structures_Location type of objects
 *
 * @category Structures
 * @package  Structures_Location
 * @author   Philippe Jausions <Philippe.Jausions@11abacus.com>
 */
interface Structures_LocationInterface
{
    /**
     * Returns the "street" address
     * 
     * "Street" is used loosely to represent any thoroughfare, place, etc...
     * A street address is usually composed of:
     * <ul>
     *  <li>thoroughfare type (i.e. avenue, boulevard, plaza, ...)</li>
     *  <li>thoroughfare number (not necessarily digits only)</li>
     *  <li>thoroughfare name</li>
     * </ul>
     * The order of these elements depends on the locale of the country.
     * Additional location information such as apartment, building, dock, unit
     * and so on should be accessed with getSecondaryUnit().
     * 
     * @return string|NULL "Street" address or NULL if none is set
     */
    public function getStreetAddress();

    /**
     * Returns the address line for apartment, suite, lot, unit, etc
     * 
     * @return string|NULL Secondary "unit" information or NULL if none is set
     */
    public function getSecondaryUnit();

    /**
     * Returns the locality
     * 
     * This is often useful for rural locations where mail is delivered to the
     * closest town. Postal office and locality are often used interchangeably,
     * but this is not always the case.
     *
     * Implementation of this interface should provide whichever is more 
     * appropriate and should also return something if either one is available. 
     *
     * @return string|NULL Locality name or NULL if none is set
     */
    public function getLocality();

    /**
     * Returns the country 2-letter ISO code
     * 
     * @return string|NULL Uppercase 2-letter ISO country code or NULL if none 
     *                     is set
     */
    public function getCountryCode();

    /**
     * Returns the region code
     * 
     * Region can be state/province/etc...
     * 
     * @return string|NULL Region code or NULL if none is set
     */
    public function getRegionCode();

    /**
     * Returns the sub region information 
     * 
     * Sub-region can be county/etc... This is of course locale-dependent
     * 
     * @return string|NULL Sub-region information or NULL if not-applicable 
     *                     or none is set
     */
    public function getSubRegion();

    /**
     * Returns a geodetic instance matching the location
     * 
     * @return Structures_Location_GeodeticInterface|NULL Instance or NULL if 
     *                                                    none is set
     */
    public function getGeodetic();

    /**
     * Sets the "street" address
     * 
     * "Street" is used loosely to represent any thoroughfare, place, etc...
     * A street address is usually composed of:
     * <ul>
     *  <li>thoroughfare type (i.e. avenue, boulevard, plaza, ...)</li>
     *  <li>thoroughfare number (not necessarily digits only)</li>
     *  <li>thoroughfare name</li>
     * </ul>
     * The order of these elements depends on the locale of the country.
     * Additional location information such as apartment, building, dock, unit
     * and so on should be provided using setSecondaryUnit().
     * 
     * @param string $address "Street" address
     * 
     * @return void
     */
    public function setStreetAddress($address);

    /**
     * Sets the address line for apartment, suite, lot, unit, etc
     * 
     * @param string $unit Secondary "unit" information
     * 
     * @return void
     */
    public function setSecondaryUnit($unit);

    /**
     * Sets the locality
     * 
     * This is often useful for rural locations where mail is delivered to the
     * closest town. Postal office and locality are often used interchangeably.
     *
     * @param string $name Locality name
     * 
     * @return void
     */
    public function setLocality($name);

    /**
     * Sets the country 2-letter ISO code
     * 
     * @param string $code 2-letter ISO country code
     * 
     * @return void
     */
    public function setCountryCode($code);

    /**
     * Sets the region code
     * 
     * Region can be state/province/etc...
     * 
     * @param string $code Region code
     * 
     * @return void
     */
    public function setRegionCode($code);

    /**
     * Sets the sub region information 
     * 
     * Sub-region can be county/etc... This is of course locale-dependent
     * 
     * @param string $name Sub-region information
     * 
     * @return void
     */
    public function setSubRegion($name);

    /**
     * Sets a geodetic instance matching the location
     * 
     * @param Structures_Location_GeodeticInterface $geo Instance
     * 
     * @return void
     */
    public function setGeodetic($geo);
}

?>